package 蓝桥真题;

import java.io.StreamCorruptedException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class 特殊时间 {
       public static void main(String[] args) {
    	   try{
			      LocalDateTime.parse("0222-02-22T02:22");
			      System.out.println("yes");                                                                                                   
	    	      }catch(Exception e){
	    	    	  System.out.println("no");
	    	      }
    	      int res=0;
    	      char[] years=new char[4];
    	      for(int i=0;i<4;i++)years[i]='1';
    	      for(int i=0;i<=9;i++){
    	    	  if(i==1)continue;
    	    	  char tt=(char)(i+'0');
    	    	  String[]ty=new String[4];
    	    	  for(int j=0;j<4;j++){
    	    		  years[j]=tt;
    	    		  ty[j]=String.valueOf(years);
    	    		  years[j]='1';
    	    	  }
    	    	  for(int y=0;y<4;y++)
    	    		  for(int m=0;m<4;m++)
    	    			  for(int d=0;d<4;d++)
    	    				  try{
    	    				      LocalDateTime.parse(ty[y]+"-"+ty[m].substring(0,2)+"-"+ty[m].substring(2,4)+"T"+ty[d].substring(0,2)+":"+ty[d].substring(2,4));
    	    				      res++;
    	    		    	      }catch(Exception e){
    	    		    	    	  
    	    		    	      }
    	      }
    	      for(int i=0;i<4;i++)years[i]='2';
    	      for(int i=0;i<=9;i++){
    	    	  if(i==2)continue;
    	    	  char tt=(char)(i+'0');
    	    	  String[]ty=new String[4];
    	    	  for(int j=0;j<4;j++){
    	    		  years[j]=tt;
    	    		  ty[j]=String.valueOf(years);
    	    		  years[j]='2';
    	    	  }
    	    	  for(int y=0;y<4;y++)
    	    		  for(int m=0;m<4;m++)
    	    			  for(int d=0;d<4;d++)
    	    				  try{
    	    				      LocalDateTime.parse(ty[y]+"-"+ty[m].substring(0,2)+"-"+ty[m].substring(2,4)+"T"+ty[d].substring(0,2)+":"+ty[d].substring(2,4));
    	    				      res++;                                                                                                                    
    	    		    	      }catch(Exception e){
    	    		    	    	  
    	    		    	      }
    	      }
    	      System.out.print(res);
	}                                                                                                                              
}
